function Menu(self) {
	self.bg = GrabImage(self.x,self.y,self.bgwidth,self.bgheight);
	while(self.run) {
		self.bg.blit(self.x,self.y);
		self.win.drawWindow(self.wx,self.wy,self.winwidth,self.items.length*self.textheight);
		self.arrow.blit(self.wx,self.wy+(self.current-1)*self.textheight);
		
		for (i in self.items) {
			self.font.drawText(self.wx+self.borderwidth,self.wy+i*self.textheight,self.items[i]);
		}
		
		FlipScreen();
		
		for (n in self.events){
			on = self.events[n][0];
			command = self.events[n][1];
			eval('if ('+on+') '+command+';');
		}
	}
}

UP = "if (self.current > 0+1) self.current-=1;SetMousePosition(self.wx,self.wy+(self.current-1)*self.textheight);";

DOWN = "if (self.current < self.items.length) self.current+=1;SetMousePosition(self.wx,self.wy+(self.current-1)*self.textheight);";

ENTER = "return";

HOME = "self.current = 1;SetMousePosition(self.wx,self.wy+(self.current-1)*self.textheight);";

END = "self.current = self.items.length;SetMousePosition(self.wx,self.wy+(self.current-1)*self.textheight);";